package com.foreverwin.mes.production.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.foreverwin.mes.meapi.model.Resrce;
import com.foreverwin.mes.production.mapper.StationResourceMapper;
import com.foreverwin.mes.production.model.StationResource;
import com.foreverwin.mes.production.service.StationResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author syngna
 * @since 2018-12-03
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class StationResourceServiceImpl extends ServiceImpl<StationResourceMapper, StationResource> implements StationResourceService {


    @Autowired
    private StationResourceMapper stationResourceMapper;

    @Override
    public List<StationResource> getStationListByResource(String sie, String resource) {
        return stationResourceMapper.selectStationListByResource(sie, resource);
    }

    @Override
    public List<Resrce> getResourceList(String stationBo) {
        return stationResourceMapper.selectResourceListByStation(stationBo);
    }

    @Override
    public int deleteResourceByStation(String stationBo) {
        return stationResourceMapper.deleteResourceByStation(stationBo);
    }

    @Override
    public int addResourceForStation(List<StationResource> list) {
        return stationResourceMapper.insertStationResource(list);
    }


}